import request from './request'
const token = localStorage.getItem('token')

export const menuList = ({ page, size, query }) => {
  return request({
    url: `menu/menuList/${page}/${size}`,
    method: 'GET',
    params: {
      query
    },
    headers: {
      accept: 'application/json',
      Authorization: `Bearer ${token}`
    }
  })
}

// 后端采用token解析出用户id去做查询比较安全 否则修改前端本地存储id也会修改导致不安全 上面的接口作废
export const menuListTest = (data) => {
  return request({
    url: 'menu/list',
    method: 'GET',
    headers: {
      accept: 'application/json',
      Authorization: `Bearer ${data}`
    }
  })
}
